package chapter9;

public class Singleton {
    private static Singleton singleton = new Singleton();
    private static int x = 0;
    private static  int y;


    public Singleton() {
        x++;
        y++;
    }
    public static Singleton getSingleton() {
        return singleton;
    }
    public static void main(String[] args) {
        Singleton singleton = Singleton.getSingleton();
        System.out.println(singleton);
        System.out.println(singleton.x);
        System.out.println(singleton.y);
    }
}
